import custom1 from './custom1.vue'
import { h, render } from 'vue'

class GlobalDialog {
  constructor() {
    const div = document.createElement('div')
    const vnode = h(custom1)
    render(vnode, div)
    document.body.appendChild(div)
    this.component = vnode.component
    console.log(this.component)
  }
}

const install = (app) => {
  console.log(app, 'app')
  let g = new GlobalDialog()
  app.config.globalProperties['$global_api'] = g.component.ctx
}

export { install }
